var gLoginUsername = "${loginUsername}"; // 获得当前登录人员的userName
var gDeptUid = '${request.getParameter("deptUid")}';

//@Bind #dsRoot.onReady
!function(self, arg) {
	self.insert({
		deptName : "资源数据"
	});

}

//@Bind #dsRoot.onReady
!function(self, arg) {
	var dsRoot = view.id("dsRoot").getData("#");
	childDepts = dsRoot.get("childDepts");
	var user = view.id("dsUser").getData("#");

	childDepts.parameter = user.get("deptUid");
	childDepts.flush();
}

//@Bind #deptTree.onDataRowClick
!function(self, arg) {
	var curEntity = self.get("currentEntity");
	var IFrame = view.id("IFrameDevice");
	if (curEntity.dataType.get("name") == "root"){
		IFrame.set("path", "view.basicdata.WorkCenter.d");
	}
	
	if (curEntity.dataType.get("name") == "dtDept"){
		IFrame.set("path", "view.basicdata.Device.d?deptUid=" + curEntity.get("uuid"));
	}
	
}
